// TOWN DIALOGUE SCRIPT
// 	Town 0: Pleasant Town

// This is the dialogue for this town.
// You can use states numbered from 1 to 99.

begintalkscript;

variables;
string dlgstr;

// *** Innkeeper ***

begintalknode 1;
	state = -1;
	personality = 1;
	nextstate = 1;
	question = "Innkeeper";
	text1 = "The innkeeper here is busy pouring drinks. He notices you approach, and he nods. _What can I do for you, travelers?_ he asks.";
	text5 = "The innkeeper continues to pour drinks as he waits for your next question.";
	action = INTRO;

begintalknode 2;
	state = 1;
	personality = 1;
	nextstate = 2;
	question = "Excuse me, sir, but may I please have a beverage?";
	text1 = "_That depends,_ he replies, frowning at you. _Are you over twenty-one, and do you have ID?_";

begintalknode 3;
	state = 2;
	personality = 1;
	nextstate = 1;
	question = "ID? Don't I look over twenty-one?";
	text1 = "_You, maybe,_ he says, _but that one_ -- he points to the third member of your party, who smiles innocently -- _I wouldn't put a day over sixteen._ Over your protests, he slides you all glasses of milk. The other patrons snicker at you.";

begintalknode 4;
	state = 2;
	personality = 1;
	nextstate = 1;
	question = "Um, sorry, must've left it in my other suit of Blessed Plate Mail.";
	text1 = "The innkeeper guffaws loudly. _You? Blessed Plate Mail? Pah!_ he pronounces with finality. _I bet you've never even worn Drakeskin Boots._ Over your protests, he slides you all glasses of milk. The other patrons snicker at you.";

begintalknode 6;
	state = 1;
	personality = 1;
	nextstate = 3;
	question = "Do you know of any valiant quests that need doing?";
	text1 = "_Valiant quests,_ he says. _Hmm, let me see, valiant quests, hmmmm._ After thinking a moment, he says, _Yes, I know of three._ He ticks them off on his fingers.";
	text2 = "_Would you like to hear about the first, which involves a dreadful kidnapping of a beautiful princess, the second, which involves a mysterious wizard in this very inn, or the third, which involves the disappearance of a priceless ring?_";

begintalknode 7;
	state = 3;
	personality = 1;
	nextstate = 3;
	question = "Tell me about the first, the beautiful princess.";
	text1 = "_Well, a few hours ago, the very attractive young daughter of the wealthiest family in town, a girl named Helena, disappeared. I think she was kidnapped by some ruffian who expected to collect a ransom._";
	text2 = "He adds darkly, _She may be tied up or worse right now, even as we speak. Her family would be very happy to find out what happened to her. The place to start looking is in the forest near here, where ruffians might hide out._";
	code =
	toggle_quest(6,1);
break;

begintalknode 8;
	state = 3;
	personality = 1;
	nextstate = 3;
	question = "Tell me about the second, the mysterious wizard.";
	text1 = "_In one of the rooms over that way_ -- he points northeast -- _there's a mysterious wizard. He hasn't talked to anyone since he got here. Rumor has it that he's waiting for adventurers to give a great and heroic quest for an artifact of great power._";
	text2 = "A mysterious wizard? A powerful artifact! This sounds like a quest specially made for you! You should check it out!";
	text3 = "_Oh, actually, he just left,_ the innkeeper remembers. _Never mind._";
	code =
	if (char_ok(15)) {
		remove_string(3);
		toggle_quest(7,1);
		}
	else {
		remove_string(1);
		remove_string(2);
		}
break;

begintalknode 9;
	state = 3;
	personality = 1;
	nextstate = 3;
	question = "Tell me about the third, the priceless ring.";
	text1 = "_John, over there,_ he says, pointing to a man sitting with his wife and friend near the entrance to the inn, _lost his wedding ring. If he doesn't find it, his wife is going to kill him. It's a beautiful ring, solid gold, with an amazing gem on it!_";
	text2 = "He adds, _He may look happy right now_ -- he does; John is grinning widely and telling a story to the two sitting with him -- _but he's really choked up inside. You wouldn't believe the agony he's going through._ The innkeeper nods confidently.";
	action = SET_SDF 0 5 1;
	code =
	toggle_quest(8,1);
break;

begintalknode 10;
	state = 1;
	personality = 1;
	nextstate = 1;
	question = "Can we get a room for the night?";
	text1 = "_For the four of you, it'll be two rooms,_ he replies, and before you can argue, he adds, _Five coins each. It's a good price. Just pay it._ You do.";
	text2 = "_You already have a room for the night,_ he replies. Oh, that's right: you already made this request. Duh.";
	text3 = "_Nope. Last night I had rooms free, but tonight, I'm going to get customers who can pay more than you scavengers can._ You start to object, but then you realize that he's probably right.";
	code =
	clear_strings();
	if (get_flag(0,1) == 1) {
		if (get_flag(0,2) == 0)
			add_string(2);
		else
			add_string(3);
		}
	if (get_flag(0,1) == 0) {
		add_string(1);
		set_flag(0,1,1);
		change_coins(-10);
		}
break;

// *** Machrone 1 ***

begintalknode 20;
	state = -1;
	personality = 2;
	nextstate = 10;
	question = "Machrone";
	text1 = "This man is elderly, with graying hair and a short beard, although his exact age is hard to estimate. His eyes look ancient, as though they have seen several lifetimes' worth of events, but his arms and his broad grin are still young and youthful.";
	text2 = "He is constantly writing everything he sees into a notepad in his hand, and even as he does so, his eyes still search his entire field of view for more information. He must have remarkable multi-tasking abilities.";
	text3 = "He greets you with a smile as you approach him. _Ah, adventurers,_ he says. _I always enjoy speaking with adventurers. Always have._";
	text5 = "Machrone jots another note as he waits for your next question.";
	action = INTRO;

begintalknode 21;
	state = 10;
	personality = 2;
	nextstate = 10;
	question = "Who are you?";
	text1 = "_Who am I?_ he repeats, chuckling. _Who are you? Can you truly answer that question?_ His eyes stare penetratingly into yours.";
	text2 = "_I am Machrone,_ he continues, _a humble journalist._ Seeing the lack of recognition in your eyes, he adds, _I seek out strange events and uncommon happenings, and I write reports about them. Then I send them to a publisher, who distributes them._";
	text3 = "He muses, _It is an unusual profession, but not nearly as unusual as when I began._";

begintalknode 22;
	state = 10;
	personality = 2;
	nextstate = 10;
	question = "Why do you like talking with adventurers?";
	text1 = "_It is my job to report on the uncommon and bizarre. Adventurers tend to bring the uncommon and bizarre with them wherever they go, and that makes my job easier._";
	text2 = "He adds, _I could talk with you for hours, but unfortunately, I do not have the time at the moment. I have a report that I have to finish by tomorrow, and I am just now organizing my notes. Perhaps later I will find the time to interview you._";

begintalknode 23;
	state = 10;
	personality = 2;
	nextstate = 10;
	question = "Where's Phaedra?";
	text1 = "Machrone looks incredibly uncomfortable. _Er, ah, ahem, that is, I really am busy, and I must get to my work._ He stubbornly refuses to elaborate.";

// *** Robin ***

begintalknode 30;
	state = -1;
	personality = 3;
	nextstate = 20;
	question = "Robin";
	text1 = "Before you stands a lovely nineteen-year-old girl with brown hair and green eyes. She hums idly to herself as she wanders in no particular direction, giggling softly to herself.";
	text2 = "A small, brownish bird with a red patch on its chest lands on her shoulder and she chirps at it briefly. It chirps back. She giggles, and it flies off.";
	text3 = "How odd.";
	text5 = "Robin hums quietly to herself as she awaits your next question.";
	action = INTRO;

begintalknode 31;
	state = 20;
	personality = 3;
	nextstate = 21;
	question = "What is your name?";
	text1 = "_My name is Evelyn,_ the girl replies.";

begintalknode 32;
	state = 21;
	personality = 3;
	nextstate = 22;
	question = "Isn't your name Robin?";
	text1 = "_Noooooo..._ she says slowly. _My name is EVELYN. I'm a woman of mystery!_";

begintalknode 33;
	state = 22;
	personality = 3;
	nextstate = 20;
	question = "No, seriously, your name is Robin. That's the title of your dialogue. That means it's your name.";
	text1 = "_Robin thinks that's silly. I mean, Evelyn thinks that's silly. I mean... oh, no._ She looks sheepish.";
	text2 = "_It's not that I'm a COMPULSIVE liar,_ she says. _It's just that it's fun. It's not that I ever KILLED anyone or anything. I mean... oh, dear. I'm going to migrate south with the other robins. Flap flap!_ She starts walking away, waving her arms.";
	text3 = "It seems unlikely that you're going to learn anything useful from this strange girl.";

// *** Mysterious Wizard ***

begintalknode 40;
	state = -1;
	personality = 4;
	nextstate = 30;
	question = "Mysterious Wizard";
	text1 = "You approach the mysterious wizard to speak to him. He gazes up from deep within his hood, and as you are subjected to his piercing stare, you notice that he has golden hourglass eyes! What a strange and mysterious person!";
	text5 = "The mysterious wizard gazes at you with a withering stare as he waits for your next inane question.";
	action = INTRO;

begintalknode 41;
	state = 30;
	personality = 4;
	nextstate = 30;
	question = "Great mysterious wizard, do you have a quest for us?";
	text1 = "He considers for a moment, and then he leans his head back slightly. The room fills with his shrill, unsettling laughter. _A quest? For you? No! What makes you think that I'm waiting in this inn for YOU?_ He laughs again.";
	text2 = "_No,_ he says, _I am waiting for some true adventurers, not cheap imitations. Now leave me be._";
	code =
	print_str_color("This quest cannot be finished. Sucks for you.",2);
	toggle_quest(7,0);
break;

// *** Townsman ***

begintalknode 50;
	state = -1;
	personality = 5;
	nextstate = 40;
	question = "Townsman";
	text1 = "This townsman is sitting at a table and drinking with his wife and a friend. What a nice, pleasant, deceptive facade to hide his deep inner pain that only you can sense!";
	text5 = "John continues to drink to drown the suffering that he must undoubtedly feel while he waits for your next question.";
	action = INTRO;

begintalknode 51;
	state = 40;
	personality = 5;
	nextstate = 40;
	question = "What is your name?";
	text1 = "_My name is John,_ he says. _What's yours?_ You ignore his question. You're the one asking him, after all.";

begintalknode 52;
	state = 40;
	personality = 5;
	nextstate = 41;
	question = "Do you have any jobs that need doing?";
	text1 = "_Um, no, not really,_ he replies. _Look,_ clearly feeling uncomfortable, _I don't have any money. Could you leave me alone and go and beg somewhere else?_";

begintalknode 53;
	state = 41;
	personality = 5;
	nextstate = -1;
	question = "Impossible! I sense great pain in you, great anguish, great suffering! Tell me your pain! Tell me and release yourself from it!";
	text1 = "_Um, you're really creeping me out now,_ he says. _Please go away._ He seems to want to stop talking to you right now. That fool!";
	action = END_TALK;

begintalknode 54;
	state = 41;
	personality = 5;
	nextstate = 42;
	condition = get_flag(0,5);
	question = "But your ring! I heard that you lost your ring!";
	text1 = "_Oh, yeah,_ John says, looking embarrassed. _Well, I did lose my ring. But I don't think it's really somewhere where you can find it. I probably left it in my other pair of pants or something. I don't really need adventurers to look for it._";

begintalknode 55;
	state = 42;
	personality = 5;
	nextstate = -1;
	question = "Nonsense! We will accept this great task and find your ring!";
	text1 = "_Um, okay._ He seems to get an idea. _I think I lost it near the... uh... Great Bugbear Cave of... um... Aizo. Why don't you go over there and see if you can find it?_";
	text2 = "The Great Bugbear Cave of Aizo? You've never heard of it, but it sounds grand enough indeed! It will be a long journey, but... wait. From the way his friend is snickering, you think that you might be missing something, but you have no idea what it is.";
	code =
	print_str_color("This quest cannot be finished. Sucks for you.",2);
	toggle_quest(8,0);
break;

// *** Machrone 2 ***

begintalknode 60;
	state = -1;
	personality = 2;
	nextstate = 50;
	question = "Machrone";
	text1 = "Machrone sits, sipping his drink quietly. Shaken up by the events of the night, he writes little on his notepad now.";

begintalknode 61;
	state = 50;
	personality = 2;
	nextstate = 50;
	question = "How are you doing after last night?";
	text1 = "_I'm fine,_ he says. _I just want my box back._";
	text3 = "_Okay,_ he says. He doesn't seem to want to talk to you.";
	action = DEP_ON_SDF 3 1 5;

begintalknode 62;
	state = 50;
	personality = 2;
	nextstate = 50;
	condition = get_flag(3,1) != 5;
	question = "What do you want us to do, again?";
	text1 = "_Get my box back from the goblins. It's a small, gold-colored, heavily locked box, and the goblins in the cave just north of here probably were the ones who stole it._";

begintalknode 63;
	state = 50;
	personality = 2;
	nextstate = 50;
	question = "Where's Phaedra?";
	text1 = "He coughs in an uncomfortable manner. _I'd, ah, rather not talk about her at the moment, if you please,_ he replies.";
	text3 = "He scowls at you but says nothing.";
	action = DEP_ON_SDF 3 1 5;

// *** Machrone 3 ***

begintalknode 65;
	state = -1;
	personality = 2;
	nextstate = 55;
	question = "Machrone";
	text1 = "Machrone jots another note as he waits for your next question, with an occasional swig from the cup in front of him.";

begintalknode 66;
	state = 55;
	personality = 2;
	nextstate = 56;
	condition = has_special_item(1) >= 1;
	question = "We have your box.";
	text1 = "_Really?_ Machrone's face lights up. _Hand it over!_ You give it to him, and he hands you your monetary compensation. He pulls out a key and moves it toward the lock, only to notice that the box's lid opens easily to the touch. It is already unlocked.";
	text2 = "Unlocked... and empty. Machrone starts suddenly at the sight. _But... but how?_ he asks himself. _Someone stole my orb?_";
	text3 = "He turns back to you. _This box is empty! It once contained my most valuable possession, the Orb of Communication, by which I relay my news back to the central publishing agency, but the orb has been stolen._";
	text4 = "He thinks. _Goblins would not be smart enough to know of its value. I cannot think who would take it. But I know who you should speak to._";
	code =
	change_spec_item(1,-1);
	change_coins(get_flag(3,1) * 100);
	toggle_quest(0,0);
break;

begintalknode 67;
	state = 56;
	personality = 2;
	nextstate = -1;
	question = "Who should we speak to?";
	text1 = "_Dan. He lives north, in Dan's Village. Tell the guards at the bridge that I sent you to speak to him, and they will let you pass._";
	text2 = "He nods. _Dan will know what to do. I have full confidence that he will give you good advice about how to win back my orb and gain glory in the process! Or something._";
	action = SET_SDF 0 7 1;
	code =
	toggle_quest(1,1);
break;

begintalknode 68;
	state = 55;
	personality = 2;
	nextstate = 55;
	condition = get_flag(0,7);
	question = "What do you want us to do, again?";
	text1 = "_Go north to Dan's Village and speak with Dan. He will tell you how to get back my orb._";

begintalknode 69;
	state = 55;
	personality = 2;
	nextstate = 55;
	question = "Where's Phaedra?";
	text1 = "Machrone's gaze refuses to meet yours. _She... she... I'm sorry, not now,_ he finally says.";

// *** Machrone 4 ***

begintalknode 75;
	state = -1;
	personality = 2;
	nextstate = 60;
	question = "Machrone";
	text1 = "Machrone sits, sipping his drink quietly and trying very hard not to meet your gaze.";

begintalknode 76;
	state = 60;
	personality = 2;
	nextstate = 61;
	question = "The archmage doesn't have your orb. Nobody does. We couldn't find it.";
	text1 = "_Well, ah, ahem, yes,_ Machrone replies, looking sheepish. _That is, actually, I still have it._";

begintalknode 77;
	state = 61;
	personality = 2;
	nextstate = 62;
	question = "What?! You still have it? Then why did you send us off looking for it?";
	text1 = "He coughs uncomfortably. _Well, you see, it's like this. On the night of the robbery, the box that I kept the orb in was stolen. I do believe that Narayan thought that he was stealing the orb when he took it._";
	text2 = "At your surprised look, he adds hastily, _Oh, ah, yes, I did go to Dan's Village myself while you were gone. I found out about Narayan. Strange fellow. Do you know that his parents... oh well, never mind._";
	text3 = "He continues, _Anyway, I came back to my room at the inn and thought, just to be sure, that I'd check under the bed. Whenever I lost anything, my wife always used to tell me to check under the bed, and you know, sometimes she was right._";

begintalknode 78;
	state = 62;
	personality = 2;
	nextstate = 63;
	question = "So what happened?";
	text1 = "_It was under the bed. I remembered that the evening before the robbery, I'd forgotten to put the orb back into its box, and it had rolled under the bed. Narayan took the box, all right, but the orb was never in it._";
	text2 = "Machrone shakes his head ruefully. _Dan knew this, too. When I went back to him and asked him about it, he told me that he never said anything to you about Narayan taking the orb, just that he was the one who stole the box._";
	text3 = "Dan knew this and still led you on that wild goose chase? How kind of him.";

begintalknode 79;
	state = 63;
	personality = 2;
	nextstate = 64;
	condition = get_flag(0,8) == 0;
	question = "What about the reward?";
	text1 = "_Well, I said I'd reward you for bringing back the orb, and since you didn't...._";
	text2 = "Machrone cuts off at that point, seeing the wild look in your eyes. He must suddenly have realized that if he finishes that thought, you may let him keep his orb -- all five hundred pieces that are left when you're done with it.";
	text3 = "_Ah, that is, I mean,_ he hastily swerves, _yes, your service was valuable, and it will be rewarded. I did play a few games of cards while you are gone, though, and I had the most unfortunate streak of bad luck...._";

begintalknode 80;
	state = 64;
	personality = 2;
	nextstate = -1;
	question = "MACHRONE, GIVE US OUR MONEY, OR SO HELP ME, GODS, I'LL...";
	text1 = "Machrone shrivels back in his chair. _Half!_ he gasps out. _Half of what was promised! That's all I have!_ He throws some coins at you.";
	text2 = "You pocket it. It's probably the best you'll get out of him. He sighs with relief and mops his brow with his napkin.";
	code =
	change_coins(get_flag(3,1) * 50);
	set_flag(0,8,1);
	toggle_quest(4,0);
	toggle_quest(5,1);
break;

begintalknode 81;
	state = 60;
	personality = 2;
	nextstate = 67;
	question = "Seriously, Machrone, where is Phaedra? Didn't you marry her?";
	code =
	clear_buffer();
	append_string("Machrone's eyes cloud over. _Yes, I did,_ he says quietly. _That was a long time ago, though, ");
	append_char_name(0);
	append_string(". Many things have happened since then._");
	get_buffer_text(dlgstr);
	message_dialog(dlgstr,"_You know what happened on the journey to the slith homeland, then, to be asking me about Phaedra. But you must not know what happened while we were there._ He sighs.");
break;

begintalknode 82;
	state = 67;
	personality = 2;
	nextstate = -1;
	question = "(Keep listening.)";
	text1 = "_After the Exodus, the expedition was trapped in Danatha for many months. Phaedra and I lived there together, taking care of Arcadia, our newborn. Those were happy days, even though our quest was stalled._";
	text2 = "A lonely tear slowly trickles from his eye, and his voice trembles. _Phaedra and I were newly married, and we were happy. But then... then...._ His voice gives out. He bows his head. _I cannot speak of it. It is still too... too much._";
	text3 = "A sigh wracks his body. _I am sorry. I cannot answer that question._";



















